<?php
//define("MESSAGE","我是一名PHP程序员");
//echo MESSAGE."<br>";
//echo Message."<br>";
//define("count","我想要怒放的生命", true);
//echo COUNT."<br>";
//echo Count."<br>";
//$name="count";
//echo constant($name)."<br>";
//echo(defined("MESSAGE"))."<br>";
//
//echo "当前文件路径:".__FILE__;
//echo "<br>当前行数:".__LINE__;
//echo "<br>当前php版本信息:".PHP_VERSION;
//echo "<br>当前操作系统:".PHP_OS;


include('input.php');
$input = new input();
// 连接数据库
include('db.php');


$content = $input->post('content');
$user = $input->post('user');

if($content == ''){
    echo "留言内容不能为空";
    exit;
}
if($user == ''){
    echo "用户名不能为空";
    exit;
}

$time=time();
echo $time;
$sql = "INSERT INTO livingMessage (`username`,`content`,`intime`) values ('$user','$content','$time')";
echo $sql;

$is=$mysqli->query($sql);
if($is){
    echo"插入成功";
}else{
    echo"插入失败";
}








?>
